home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
5791-.end
/
dmg-6260
/
articles
/
colours.doc
< prev
next >
Wrap
Text File
|
1993-07-01
|
2KB
|
77 lines
QUICK PALETTE CHANGER
~~~~~~~~~~~~~~~~~~~~~~~
I bet some of you out there who do a lot of word processing would love
to find an easy way to change the rather dross GEM colours to something
more relaxing. Well, I very proudly present (very proudly, because it's
my first assembly program, which I did all by my little self!) a small
program which can change the colours for you. Here it is:
clr.l -(sp)
move.w #$20,-(sp)
trap #1
add.l #6,sp
move.l d0,up_save
move.w #0,$ff8240
move.w #$777,$ff8242
move.w #3,$ff8244
move.w #$770,$ff8246
move.l #txt,-(sp)
move.w #9,-(sp)
trap #1
addq.l #6,sp
move.l #100000,d0
pause:
dbra d0,pause
move.l up_save,-(sp)
move.w #$20,-(sp)
trap #1
add.l #6,sp
move.w #20,-(sp)
move.w #$4c,-(sp)
trap #1
txt: dc.b "BLACK EAGLE desktop colour changer",0
up_save:ds.l 1
I couldn't be bothered to 'rem' it, so here's the description:
First 5 lines: Enter supervisor mode (you have to be in supervisor mode
to be able to change the hardware palette)
Lines 7 to 10: Change the colours (here, they are black, white, blue,
and yellow)
Lines 11 to 14:Print out message (at end of code)
Lines 15 to 17:Pause a bit for the message
Lines 19 to 22:Return out of supervisor mode
Lines 24 to 26:Exit cleanly
Lines 27 to 28:Set up space for message and non-supervisor mode.
Any assembler at all should be able to assemble this code. Simply
change the colour data if required, and assemble it. (Knowing you, you
will probably change the message, and take all of the credit...)
The file COLOURS.S and COLOURS.PRG are included somewhere on this disk.
The above program is for medium resolution. If you want to change the
16-colour low-resolution palette, shove these lines in after line 10:
move.w #$rgb,$ff8248
move.w #$rgb,$ff824A
move.w #$rgb,$ff824C
move.w #$rgb,$ff824E
move.w #$rgb,$ff8250
move.w #$rgb,$ff8252
move.w #$rgb,$ff8254
move.w #$rgb,$ff8256
move.w #$rgb,$ff8258
move.w #$rgb,$ff825A
move.w #$rgb,$ff825C
move.w #$rgb,$ff825E
Swap the 'rgb' for your usual hexadecimal colour values.
Article: BLACK EAGLE 1/7/93